import request from '@/utils/request'
import myRequest from '@/utils/myRequest'
// import qs from 'qs'

/**
 * 薪资管理-工资制作-获取列表 新增获取员工列表
 * url:'/hr/salaryMonth/make/employeeList'
 * method:GET
 * @Header Authorization: 登录接口返回的token
 * @Query params:{
    deptId: '', // 部门
    salaryDate: '' // 发放月份
 * }
 * @returns {*}
 */
export const getEmployeeListCreateAPI = (params = {}) => {
  return request.get('/hr/salaryMonth/make/employeeList', {
    params
  })
}

/**
 * 薪资管理-工资制作-获取列表 修改获取员工列表
 * url:'/hr/salaryMonth/make/getSubmission/${id}'
 * method:GET
 * @Header Authorization: 登录接口返回的token
 * @Query params:{
    id: '' // 月薪列表ID
 * }
 * @returns {*}
 */
export const getEmployeeListUpdateAPI = (params = {}) => {
  return request.get(`/hr/salaryMonth/make/getSubmission/${params.id}`, {})
}

/**
 * 薪资管理-工资制作-保存
 * url:'/hr/salaryMonth/make/save'
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const saveSalarymakeAPI = (params = {}) => {
  return request.post('/hr/salaryMonth/make/save', params)
}

/**
 * 薪资管理-工资制作-重做
 * url:'/hr/salaryMonth/make/remake'
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const redoSalarymakeAPI = (params = {}) => {
  return request.post('/hr/salaryMonth/make/remake', params)
}

/**
 * 薪资管理-管理列表-提交审批
 * url:'/hr/salaryMonth/make/commit'
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const submitApproveAPI = (params = {}) => {
  return request.post(`/hr/salaryMonth/make/commit`, params)
}

/**
 * 薪资管理-管理列表-导出
 * url:'/hr/salaryMonth/make/export/${id}'
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const exportListAPI = (params = {}) => {
  return myRequest({
    method: 'get',
    url: `/hr/salaryMonth/make/export/${params.id}`,
    responseType: 'blob'
  })
}

/**
 * 薪资管理-工资补发-保存
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const saveSalarymakeAPI2 = (params = {}) => {
  return request.post('/hr/salaryMonth/reissue/save', params)
}

/**
 * 薪资管理-管理列表-补发提交审批
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const submitApproveAPI2 = (params = {}) => {
  return request.post(`/hr/salaryMonth/reissue/commit`, params)
}

/**
 * 薪资管理-管理列表-补发导出
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const exportListAPI2 = (params = {}) => {
  return myRequest({
    method: 'get',
    url: `/hr/salaryMonth/reissue/export/${params.id}`,
    responseType: 'blob'
  })
}
/**
 * 薪资管理-管理列表-股份公司
 * method:POST
 * @Header Authorization: 登录接口返回的token
 * @Query params:{}
 * @returns {*}
 */
export const exportListAPI3 = (params = {}) => {
  return myRequest({
    method: 'get',
    url: `/hr/salaryMonth/make/exportShare/${params.id}`,
    responseType: 'blob'
  })
}
